import AudioManager from "../AudioManager";
import GameData from "../GameData";
import GameManager from "../GameManager";
import { TweenType } from "../WTool";

const { ccclass, property } = cc._decorator;

@ccclass
export default class Build extends cc.Component {

    protected start(): void {

    }

    /** 种植或触摸Tween */
    Duang() {
        cc.tween(this.node)
            .to(0.2, { scaleX: 0.8, scaleY: 1.4 })
            .to(0.2, { scaleX: 1, scaleY: 1 })
            .start()
    }


    onCollisionEnter(other, self) {
        if (other.node.name == "Touch") {
            this.Duang();
            if (GameManager.Instance.GameUI.getChildByName("开局引导").active && GameManager.IsGuided) {
                GameManager.Instance.GameUI.getChildByName("开局引导").active = false;
            }
        }
    }
}
